<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//首页
Route::get('/', 'Client\IndexController@index');
//详情页
Route::get('/article/{id}','Client\IndexController@cardArticle1');
//注册
Route::get('/users/register','Client\UsersController@showRegister');
Route::post('/users/register','Client\UsersController@register')->name('register');
//登录登出
Route::post('/diylogin','Client\UsersController@diyLogin')->name('login');

//发帖
Route::post('/createArticle','Client\ReplyController@createArticle');
Route::post('/createReply','Client\ReplyController@createReply');

Route::group(['middleware'=>'check_login'],function(){
  //个人中心
  Route::get('/usersCenter','Client\UsersController@usersCenter');
  Route::get('/usersComment','Client\UsersController@usersComment');
  Route::get('/usersPosted','Client\UsersController@usersPosted');
  Route::post('/insertSex','Client\UsersController@insertSex');
  Route::post('/insertAge','Client\UsersController@insertAge');
  //登出
  Route::get('/clientLogout','Client\UsersController@clientLogout');
  //投稿页
  Route::get('/fatie','Client\IndexController@fatie');

});



//ajax
Route::post('/ajaxupload','Client\ReplyController@ajaxupload');
Route::get('/ajaxupload','Client\ReplyController@ajaxupload');
Route::get('/ajaxzan','Client\IndexController@ajaxdianzan');
Route::get('/ajaxchai','Client\IndexController@ajaxchai');
Route::post('/usersCenter/ajaxtouxiang','Client\UsersController@ajaxtouxiang');
Route::get('/msgspush','Client\IndexController@msgsPush');//ajax轮询消息推送

// Route::get('deletetest','Client\UsersController@dddd');

//ADMIN\users
Route::get('admin/login','Admin\LoginController@adminLogin')->name('adminLogin');
Route::get('admin/index','Admin\AdminController@index');
Route::get('admin/users/lst','Admin\UsersController@lst');
Route::get('admin/users/disable/{id}','Admin\UsersController@userDisable');

//微信相关
Route::get('/getwxToken','WxController@getwxToken');//获取access_token
Route::get('/createMenu','WxController@createMenu');//创建自定义菜单
Route::get('/getOpenId','WxController@getOpenId');//获取openid
Route::get('/createMem','WxController@createMembershipCard');//创建会员卡
Route::get('/getMemQRcode','WxController@getMemQRcode');//获取会员卡二维码
Route::get('/setwhitename','WxController@setwhitename');//设置测试会员卡白名单
